package com.hongyuan.sellfitness.ui.person.view_mode;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.hongyuan.sellfitness.base.Constants;
import com.hongyuan.sellfitness.base.CustomViewModel;
import com.hongyuan.sellfitness.data.MyRepository;
import com.hongyuan.sellfitness.ui.home.beans.CardDetailsBean;
import com.hongyuan.sellfitness.ui.person.beans.MyCardDetailBean;

public class MyCardDetailsViewModel extends CustomViewModel<MyRepository> {

    public ObservableField<MyCardDetailBean.InfoBean> entity = new ObservableField<>();

    public MyCardDetailsViewModel(@NonNull Application application, MyRepository model) {
        super(application, model);
    }

    @Override
    protected void returnData(int code, Object dataBean) {
        super.returnData(code, dataBean);

        if(code == Constants.GET_MY_CARD_INFO){

            MyCardDetailBean.InfoBean bean = ((MyCardDetailBean)dataBean).getInfo();
            entity.set(bean);
            
        }
    }
}
